<%@ page language="java" import="java.util.*" pageEncoding="utf-8"  isELIgnored="false"%>
<%@ include file="../tag.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>IT园_${question.questionTitle}</title>
<meta name="Keywords"
	content="回答详情、问题详情">
<meta name="description"
	content="问题的回答详情">
<%@ include file="../base.jsp"%>
<%@ include file="../alert-common.jsp"%>
<%@ include file="../window-common.jsp"%>
<script src="js/public.js"></script>
<script src="js/expose.js"></script>
<script type="text/javascript">
	function quesAnswer(){
					 var chName = $('#currentChName').val();
					$.ajax({
					type:'POST',
					url:'expose/question/questionAnswer',
					data:{'questionId':$('#questionId').val(),'questionAnswer':$(".pinglun-content").html()},
					dataType:'json',
					 success:function(data){
								if(data && data.success){
									showAlertDiv(data.msg);
									var cLi = "<li style=\"width: 710px;\"><div style=\"float: left;width: 80px;height: 70px;\"><img style=\"border-radius:50%;width: 65px;height: 65px;\" src=\"expose/article/showPicture/"+data.object.answerUserId+"\" /></div><div style=\"width: 620px;float: left;\"><div class=\"pinglun-date\" style=\"width: 620px;\">"+chName+":&nbsp;&nbsp;"+formatDate(data.object.createDate)+"</div><div class=\"pinglun-comment\" style=\"word-wrap:break-word;\">"+data.object.questionAnswer+"</div></div></li>";
									$(".pinglun-list ul").prepend(cLi);
								}else if(data.status == 100){
									showDiv(data.msg);
								}else{
									showAlertDiv(data.msg);
								}
						}
				}); 
			}
</script>
<style type="text/css">
	.div-left{
			float: left;
			width: 720px;
			font-size:14px;
			height: 300px;
			margin: 15px 0 0 10px;
	}
	
	.div-left table tr{
		height: 35px;
	}
	.div-left table tr td div{
		height: 35px;
		margin-right: 15px;
	}
	
	.pinglun-content,.biaoqing-fabu{
		width: 550px;
	}
	.yc_content_inner{
		margin-top: 2px;
	}
	
	.question-gz{
		float: left;
		background: #5CB85C;
		width: 60px;
		line-height: 30px;
		text-align: center;
		color: #fff;
		border: 1px solid #51B151;
	}
	
	.question-gz:HOVER{
		background: #449D44;
	}
	
	.question-sc{
		float: left;
		border:1px solid #CCCCCC;
		width: 60px;
		height: 30px;
		line-height: 30px;
		text-align: center;
		font-weight: bold;
	}
	.question-sc:HOVER{
		background: #E6E6E6;
	}
	
	.question-user{
		color: #449D44;
		font-size: 14px;
		font-weight: bold;	
	}
	
	.question-user:HOVER{
		color: #000;
		text-decoration: underline;
	}

</style>
</head>
<body>
	<jsp:include page="/expose/top.jsp"></jsp:include>
	<input type="hidden" value="${user.chName }" id="currentChName"> 
	<input type="hidden" value="${question.id}" id="questionId" />
	<div class="yc_content_inner">
		<div  style="border-right: 1px dashed #EB7351;width: 760px;float: left;">
				<div class="div-left">
							<div style="float: left;width: 100%; "><h1 style="font-size: 18px;font-weight: bold;">${question.questionTitle}</h1></div>
							<div style="float: left;height: 30px;width: 100%;margin-top: 15px;font-size: 14px;color: #017E66;">关键词:${question.questionKeyword}</div>
							<div style="float: left;height: 40px;background: #F9FBFB;border:1px solid #F0F5F3;width: 100%;margin: 5px 0;"><span style="float: left;margin-top: 7px;">回答被采纳后即可获得 ${question.questionIntegral} 分。</span></div>
							<div style="width: 100%;height: 380px;">${question.questionDetail}</div>
							<div style="float: left;"><font color="#999999">${questionAnswers.size()}条回答</font> 分类:<a style="color: #999;" href="expose/question/questionByTypeList?id=${questionType.id}">${questionType.questionTypeName }</a></div>
				</div>
				<div class="yc_content_inner">
						 		<div class="comment" style="margin-top: 100px;" >
						 			<div class="pinglun-content" contenteditable="true" style="width: 730px;">来说两句吧...</div>
						 				<div  class="biaoqing-fabu"   style="width: 730px;">
							 				<div class="biaoqing">
							 					<a href="javascript:void(0);" >插入表情</a>
							 				</div>
								 			<div>
								 				<a href="javascript:void(0);" class="fabu" onclick="quesAnswer();">回&nbsp;&nbsp;答</a>
								 			</div>
						 				</div>
						 		</div><br>
						 		<div class="pinglun-list">
							 		<ul>
							 		 <c:forEach items="${questionAnswers }" var="questionAnswer" varStatus="qw">
							 				<li style="width: 730px;">
							 					<div style="float: left;width: 80px;height: 70px;">
							 						<img style="border-radius:50%;width: 65px;height: 65px;" src="expose/article/showPicture/${questionAnswer.answerUserId }" />
							 					</div>
							 					<div style="width: 640px;float: left;">
									 					<div class="pinglun-date" style="width: 640px;">
									 							${questionAnswer.user.chName}:&nbsp;&nbsp;<fmt:formatDate value="${questionAnswer.createDate}" pattern="yyyy-MM-dd HH:mm:ss" />
									 					</div>
									 					<div class="pinglun-comment" style="word-wrap:break-word;">${questionAnswer.questionAnswer }</div>
							 					</div>
							 				</li>
 							 		</c:forEach>
						 		</ul>
						 		</div>
				</div>
		</div>
			<div  style="width: 344px;height:120px;float: left;margin-left: 30px;">
					<div style="width: 100%;height: 30px;">
						<span class = "question-gz" ><a href="javascript:void(0);" style="color: #fff;" onclick="operation(1)">关注</a></span>
						 <span style="float: left;margin-left: 15px;font-weight: bold;line-height: 30px;font-size: 15px;" id="gz">${question.questionAbout}</span>
					 	<span style="float: left;color: #999999;line-height: 30px;margin-left: 4px;">关注</span>
					 </div>
					<div style="width: 100%;height: 30px;margin-top: 12px;">
						<span class = "question-sc"><a href="javascript:void(0);" style="color: #000;" onclick="operation(2)">收藏</a></span>
						<span style="float: left;margin-left: 15px;font-weight: bold;line-height: 30px;font-size: 15px;" id="sc">${question.questionCollection}</span>
						<span style="float: left;color: #999999;line-height: 30px;margin-left: 4px;">收藏</span>
						<span style="float: left;margin-left: 15px;font-weight: bold;line-height: 30px;font-size: 15px;">${question.questionClick}</span>
						<span style="float: left;color: #999999;line-height: 30px;margin-left: 4px;">浏览</span>
						<div style="width: 100%;float: left;margin-top: 12px;"><a href="#" class="question-user">${question.user.chName}</a><span>提出于</span><fmt:formatDate value="${question.createDate}" pattern="yyyy-MM-dd HH:mm:ss" /></div>
					</div>
			</div>
			<div style="width: 344px;background:#5CB85C;color:#fff;font-size:14px;height:35px;line-height:35px;text-align:center;float: left;border:1px solid #DDDDDD;margin-left: 30px;margin-bottom: 10px;">
				<c:if test="${empty user}">
					<a href="javascript:void(0);" onclick="showDiv('你还未登录，请登录后再操作!')" style="color: #fff;">我要提问</a>
				</c:if>
				<c:if test="${ !empty user}">
					<a href="user/question/questionManage" style="color: #fff;">查看我的提问</a>
				</c:if>
				
			</div>
			<div style="width: 344px;height:340px;float: left;border:1px solid #DDDDDD;margin-left: 30px;">
						
						<div style="width: 344px;height: 35px;line-height: 35px;text-align: center;border-bottom: 1px solid #DDDDDD;">
							<span style="font-weight: bold;font-size: 14px;">相似问题</span>
						</div>
						<div>
						
						</div>
				</div>
	</div>
	<jsp:include page="/expose/bottom.jsp"></jsp:include>
</body>
</html>
